package service;

import dao.ProductDetailsDao;
import entity.ProductDetails;
import org.springframework.beans.factory.annotation.Autowired;

import javax.transaction.Transactional;

/**
 * Created by jifeng on 2016/12/20 0020.
 */
@Transactional
public class ProductDetailsService {
    @Autowired
    private ProductDetailsDao productDetailsDao;

    public ProductDetailsDao getProductDetailsDao() {
        return productDetailsDao;
    }

    public void setProductDetailsDao(ProductDetailsDao productDetailsDao) {
        this.productDetailsDao = productDetailsDao;
    }

    public ProductDetails addProductDetails(ProductDetails productDetails){
        productDetailsDao.addProductDetails(productDetails);
        return productDetails;
    }

    public ProductDetails findProductDetailsById(int id){
        return productDetailsDao.findProductDetailsById(id);
    }

    public void updateProductDetails(ProductDetails productDetails){
        productDetailsDao.updateProductDetails(productDetails);
    }
}
